﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;
using System.Runtime.Serialization;
using System.ComponentModel;
 
namespace Genespy
{
    [DataContract]
    public class Report : INotifyPropertyChanged
    {
        private string _title;
        private List<Note> _notes; 
        private List<MediaObject> _videos;
        private List<MediaObject> _pictures;
        private List<MediaObject> _audio;
        private DateTime _date; 

        [DataMember]
        public string title
        {
            get { return _title; }
            set
            {
                if (_title!= value)
                {
                    _title = value;
                    OnPropertyChanged("title");
                }
            }
        }
        [DataMember]
        public DateTime date
        {
            get { return _date; }
            set
            {
                if (_date != value)
                {
                    _date = value;
                    OnPropertyChanged("date");
                }
            }
        }
        [DataMember]
        public List<Note> notes
        {
            get { return _notes; }
            set
            {
                if (_notes != value)
                {
                    _notes = value;
                    OnPropertyChanged("notes");
                }
            }
        }
        [DataMember]
        public List<MediaObject> videos
        {
            get { return _videos; }
            set
            {
                if (_videos != value)
                {
                    _videos = value;
                    OnPropertyChanged("videos");
                }
            }
        }
        [DataMember]
        public List<MediaObject> pictures 
        {
            get { return _pictures; }
            set
            {
                if (_pictures != value)
                {
                    _pictures= value;
                    OnPropertyChanged("pictures");
                }
            }
        }
        [DataMember]
        public List<MediaObject> audio
        {
            get { return _audio; }
            set
            {
                if (_audio != value)
                {
                    _audio = value;
                    OnPropertyChanged("audio");
                }
            }
        }

        public Report(){
            title = "Unnamed Report";
            notes = new List<Note>();
            videos = new List<MediaObject>();
            pictures = new List<MediaObject>();
            audio = new List<MediaObject>();
            date = DateTime.UtcNow;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(String propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
